#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;

using ll = long long;

int main() {
    ll n, k;
    scanf("%lld %lld", &n, &k);
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
    }

    if (k > n) {
        printf("0.00\n");
        return 0;
    }

    sort(a.begin(), a.end());
    vector<double> p(n + 1, 0.0);
    for (int i = 0; i < n; i++) {
        p[i + 1] = p[i] + a[i];
    }

    double l = 0.0, r = 1e14;
    for (int iter = 0; iter < 100; iter++) {
        double mid = (l + r) / 2.0;
        auto it = lower_bound(a.begin(), a.end(), mid);
        int pos = it - a.begin();
        
        double sum = p[pos] + (n - pos) * mid;
        if (sum >= k * mid) {
            l = mid;
        } else {
            r = mid;
        }
    }

    double ans = (l + r) / 2.0;
    printf("%.2f\n", ans);
    return 0;
}